package com.example.tys.oomdata;

import com.example.tys.oomdata.sqLiteData.DataAnnotation;

import java.util.Arrays;

/**
 * 每一要插入数据库的对象，必须要有一个PrimaryKey 或者Unique，用来唯一确定一个对象
 *
 * @author tys
 * @date 2018/3/9
 */
@DataAnnotation.TableName(name = "tys")
public class Test {


    //PrimaryKey sqlite不需要设置 AUTO_INCREMENT，自增长 不要去设置他的值
    @DataAnnotation.PrimaryKey
    @DataAnnotation.InDbName("_Id")
    private Integer anInt;

    //不设置值时 默认值
    @DataAnnotation.Default(value = "999")
    private Long anLong;

    /**
     *字段值唯一，允许空字符(不设置值)重复出现,但是没有意义 删除不了
     */
    private String aString;

    @DataAnnotation.NotNull
    private Double aDouble;

    @DataAnnotation.InDbName(value = "aaa")
    private Boolean aBoolean;

    private byte[] aByte;

    private Short aShort;

    private Float aFloat;

    public Integer getAnInt() {
        return anInt;
    }

    public void setAnInt(Integer anInt) {
        this.anInt = anInt;
    }

    public Long getAnLong() {
        return anLong;
    }

    public void setAnLong(Long anLong) {
        this.anLong = anLong;
    }

    public Double getaDouble() {
        return aDouble;
    }

    public void setaDouble(Double aDouble) {
        this.aDouble = aDouble;
    }

    public String getaString() {
        return aString;
    }

    public void setaString(String aString) {
        this.aString = aString;
    }

    public Boolean getaBoolean() {
        return aBoolean;
    }

    public void setaBoolean(Boolean aBoolean) {
        this.aBoolean = aBoolean;
    }

    public byte[] getaByte() {
        return aByte;
    }

    public void setaByte(byte[] aByte) {
        this.aByte = aByte;
    }

    public Short getaShort() {
        return aShort;
    }

    public void setaShort(Short aShort) {
        this.aShort = aShort;
    }

    public Float getaFloat() {
        return aFloat;
    }

    public void setaFloat(Float aFloat) {
        this.aFloat = aFloat;
    }

    @Override
    public String toString() {
        return "Test{" +
                "anInt=" + anInt +
                ", anLong=" + anLong +
                ", aString='" + aString + '\'' +
                ", aDouble=" + aDouble +
                ", aBoolean=" + aBoolean +
                ", aByte=" + Arrays.toString(aByte) +
                ", aShort=" + aShort +
                ", aFloat=" + aFloat +
                '}';
    }
}
